package cn.stylefeng.guns.sys.modular.system.mapper;

import cn.stylefeng.guns.sys.modular.system.entity.Huopei;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;


public interface HuopeiMapper extends BaseMapper<Huopei> {

    int insert(Huopei record);

    List<Huopei> listExport(@Param("shopName") String shopName, @Param("beginTime") Date beginTime);

    IPage huopeiList(@Param("page") Page page, @Param("huopei") Huopei huopei, @Param("timeLimit") String timeLimit);
//    List<Huopei> huopeiList(@Param("huopei") Huopei huopei, @Param("timeLimit") String timeLimit);

    Huopei getByShopCode(@Param("shopCode") String shopCode, @Param("beginTime") Date beginTime);

//    List<Huopei> getHuopei(Huopei huopei);

    List<Huopei> getHuopei(@Param("huopei") Huopei huopei, @Param("date") String date);


    List<Huopei> selectClassName(Huopei huopei);

    List<Huopei> exportClass(Huopei huopei);

    int update(Huopei huopei);

//    IPage list(@Param("page") Page page, @Param("dm") List dm,@Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    IPage list(@Param("page") Page page, @Param("dm") List dm, @Param("timeLimit") String timeLimit);


    List<String> dmList(String name);

    List kjList(String name);

    List dzList(String name);

    List listDz(String name);

    String selectDz(String shopCode);

    List<String> selectCw(Long createUser);

    int updateNum(@Param("num") String num, @Param("shopCode") String shopCode, @Param("proCode") String proCode, @Param("beginTime") Date beginTime);

    int updateHp(Huopei huopei);

    String selectDm(String shopCode);

    List<Huopei> selectTime(@Param("huopei") Huopei param, @Param("date") String date);

    List<Huopei> exportTime(@Param("huopei") Huopei param, @Param("date") String date);

    /**
     * 查询数据库中是否存在该店该时间段的数据
     * @param shopCode
     * @param beginTime
     * @return
     */
    int count(@Param("shopCode") String shopCode, @Param("beginTime") Date beginTime);

    /**
     * 删除货赔表数据
     * @param shopCode
     * @param beginTime
     */
    void delete(@Param("shopCode") String shopCode, @Param("beginTime") Date beginTime);

    void insertList(@Param("list") List<Huopei> huopeiList);

    List<Huopei> getExport(@Param("huopei") Huopei param, @Param("date") String date);

    List<Huopei> hpList(@Param("dmList") List<String> dmList, @Param("date") String date);

    List<Huopei> nameList(@Param("dmList") List<String> dmList);

    List<Huopei> timeList(@Param("dmList") List<String> dmList, @Param("date") String date);
}